
#pragma once

#include <math.h>

#include "vector2.h"
#include "matrix4.h"
#include "quaternion.h"

struct vector3
{
	float x, y, z;
};

__declspec(dllexport) void vector3_create(float x, float y, float z, struct vector3* v_out);
__declspec(dllexport) void vector3_create_single(float value, struct vector3* v_out);
__declspec(dllexport) void vector3_create_vector2(const struct vector2* v, float z, struct vector3* v_out);
__declspec(dllexport) void vector3_add(const struct vector3* v1, const struct vector3* v2, struct vector3* v_out);
__declspec(dllexport) void vector3_barycentric(const struct vector3* v1, const struct vector3* v2,
											   const struct vector3* v3, float amt1, float amt2,
											   struct vector3* v_out);
__declspec(dllexport) void vector3_catmullrom(const struct vector3* v1, const struct vector3* v2, const struct vector3* v3, 
											  const struct vector3* v4, float amt, struct vector3* v_out);
__declspec(dllexport) void vector3_clamp(const struct vector3* v_in, const struct vector3* min, const struct vector3* max, struct vector3* v_out);
__declspec(dllexport) void vector3_cross(const struct vector3* v1, const struct vector3* v2, struct vector3* v_out);
__declspec(dllexport) void vector3_dist(const struct vector3* v1, const struct vector3* v2, float* f_out);
__declspec(dllexport) void vector3_distsqr(const struct vector3* v1, const struct vector3* v2, float* f_out);
__declspec(dllexport) void vector3_div(const struct vector3* v1, const struct vector3* v2, struct vector3* v_out);
__declspec(dllexport) void vector3_divf(const struct vector3* v, float n, struct vector3* v_out);
__declspec(dllexport) void vector3_dot(const struct vector3* v1, const struct vector3* v2, float* f_out);
__declspec(dllexport) void vector3_equals(const struct vector3* v1, const struct vector3* v2, int* result);
__declspec(dllexport) void vector3_hermite(const struct vector3* v1, const struct vector3* tangent1, const struct vector3* v2, const struct vector3* tangent2, float amt, struct vector3* v_out);
__declspec(dllexport) void vector3_len(const struct vector3* v, float* f_out);
__declspec(dllexport) void vector3_lensqr(const struct vector3* v, float* f_out);
__declspec(dllexport) void vector3_lerp(const struct vector3* v1, const struct vector3* v2, float amt, struct vector3* v_out);
__declspec(dllexport) void vector3_max(const struct vector3* v1, const struct vector3* v2, struct vector3* v_out);
__declspec(dllexport) void vector3_min(const struct vector3* v1, const struct vector3* v2, struct vector3* v_out);
__declspec(dllexport) void vector3_mult(const struct vector3* v1, const struct vector3* v2, struct vector3* v_out);
__declspec(dllexport) void vector3_multf(const struct vector3* v, float scale, struct vector3* v_out);
__declspec(dllexport) void vector3_negate(const struct vector3* v, struct vector3* v_out);
__declspec(dllexport) void vector3_normalize(const struct vector3* v, struct vector3* v_out);
__declspec(dllexport) void vector3_reflect(const struct vector3* v, const struct vector3* normal, struct vector3* v_out);
__declspec(dllexport) void vector3_smoothstep(const struct vector3* v1, const struct vector3* v2, float amt, struct vector3* v_out);
__declspec(dllexport) void vector3_subt(const struct vector3* v1, const struct vector3* v2, struct vector3* v_out);
__declspec(dllexport) void vector3_transform_matrix4(const struct vector3* pos, const struct matrix4* matrix, struct vector3* v_out);
__declspec(dllexport) void vector3_transform_quaternion(const struct vector3* v, const struct quaternion* rotation, struct vector3* v_out);
__declspec(dllexport) void vector3_transformnormal(const struct vector3* normal, const struct matrix4* matrix, struct vector3* v_out);
